<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
<title><?= $sf_response->getTitle() ?></title>
<?php use_stylesheet('/sf/sf_admin/css/main') ?>
<style type="text/css">
<!--
.style1 {font-size: 12px}
.style2 {font-size: 11px}
.style3 {font-size: 13px; }
.style4 {font-size: 10px}
.style7 {font-size: 10px; font-style: italic; }
.style8 {font-size: 12px; font-style: italic; }
-->
</style>
<table width="100%" border="0">
  <tr>
    <td width="20%"><p>PHI&#7870;U Y&Ecirc;U C&#7846;U V&#7852;T T&#431;</p>
    <p><span class="style1">MATERIAL REQUISITE </span></p></td>
    <td width="59%">&nbsp;</td>
    <td width="8%"><p>No:</p>
    <p class="style4">S&#7889;</p></td>
    <td width="13%"><?echo $mr->getMrno()?></td>
  </tr>
  <tr>
    <td><p>Project:</p>
    <p class="style2">C&ocirc;ng tr&igrave;nh </p></td>
    <td><? echo isset($projectname)? $projectname: '&nbsp;'?>
    <p class="style2">&nbsp;</p></td>
    <td><p class="style4">Ref.</p>
    <p class="style4">TL tham chi&#7871;u </p></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><p>Client:</p>
    <p class="style3">Kh&aacute;ch h&agrave;ng </p></td>
    <td><? echo isset($clientname)? $clientname: '&nbsp;'?>
    <p class="style2">&nbsp;</p></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><span class="style3">Sale Confirmation No: </span></td>
    <td><? echo isset($saleno)? $saleno: '&nbsp;'?></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
  <tr>
    <td><p align="center">No</p>
    <p align="center" class="style7">STT</p></td>
    <td><p align="center">Description</p>
    <p align="center" class="style7">M&ocirc; t&#7843; h&agrave;ng h&oacute;a/ d&#7883;ch v&#7909; </p></td>
    <td><p align="center">Code</p>
    <p align="center" class="style7">M&atilde; s&#7889; </p></td>
    <td><p align="center">Brand</p>
    <p align="center" class="style7">Nh&atilde;n hi&#7879;u </p></td>
    <td><p align="center">Unit</p>
    <p align="center" class="style7">&#272;v&#7883; </p></td>
    <td><p align="center">Qty/Min.Qty (for stock)</p>
      <p align="center" class="style7">SL/SL tk t&#7889;i thi&#7875;u  </p></td>
    <td><p align="center">Expect Delivery</p>
    <p align="center" class="style7">Ng&agrave;y YC nh&#7853;n h&agrave;ng </p></td>
    <td><p align="center">Existing stock</p>
    <p align="center" class="style7">T&#7891;n kho </p></td>
    <td><p align="center">Purchase</p>
    <p align="center" class="style7">YC mua </p></td>
  </tr>

<? foreach( $compsList as $key=>$comps) {
    $comp = ComponentPeer::retrieveByPK($comps->getComponentId());
    //$comp = new Component();
    if ($hasBOM) {
        $c = new Criteria();
        $c->add(ComponentsPeer::COMPONENTGROUP_ID , $BOMcompGroupId);
        $c->add(ComponentsPeer::COMPONENT_ID , $comp->getId());
        $BOMcomps = ComponentsPeer::doSelectOne($c);
    }
?>   
  <tr>
    <td><div align="center"><?echo $key+1?></div></td>
    <td><div align="center"><?echo $comp->getDescription()?></div></td>
    <td><div align="center"><?echo $comp->getProductcode()?></div></td>
    <td><div align="center"><?echo $comp->getBrand()?></div></td>
    <td><div align="center"><?echo $comp->getComponentUnit()?></div></td>
    <td><div align="center"><?if ($hasBOM && $BOMcomps) echo $BOMcomps->getQty1(); else echo '&nbsp;'?></div></td>
    <td><div align="center"><? echo $mr->getReqarrdate()? $mr->getReqarrdate(): '&nbsp;'?></div></td>
    <td><div align="center"><?if ($hasBOM && $BOMcomps) echo $BOMcomps->getQty1() - $comps->getQty1(); else echo '&nbsp;'?></div></td>
    <td><div align="center"><?echo $comps->getQty1()?></div></td>
  </tr>
<?}?>
</table>
<p>&nbsp;</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="58%"><table width="80%" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="30%"><p align="center">Th&#7911; kho</p>
              <p align="center" class="style8">StoreKeeper</p>
              <p align="center" class="style8">&nbsp;</p>
              <p align="center">Ng&agrave;y</p>
              <p align="center" class="style8">Date  </p></td>
            <td width="30%"><p align="center">Ng&#432;&#7901;i y&ecirc;u c&#7847;u</p>
              <p align="center" class="style8">Requested by</p>
              <p align="center" class="style8"><? echo $CreateName?>&nbsp;</p>
              <p align="center">Ng&agrave;y</p>
              <p align="center" class="style8">Date  </p></td>
            <td width="40%"><p align="center">Manager</p>
              <p align="center"><?echo $ManagerName?>&nbsp;</p>
              <p align="center"><?if ($ManagerName) echo 'Electronically Approved'?>&nbsp;</p>
              <p align="center">Ng&agrave;y</p>
              <p align="center" class="style8">Date</p></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="42%"><div align="right"><table width="466" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="462"><div align="right">
        <table width="464" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="50%"><p align="center">Tr&#432;&#7903;ng B&#7897; Ph&#7853;n </p>
                  <p align="center" class="style8">Head of Support</p>
                  <p align="center" ><?echo $HOSName?>&nbsp;</p>
                <p align="center"><?if ($HOSName) echo 'Electronically Approved'?>&nbsp;</p>
                <p align="center">&nbsp;</p></td>
              <td ><p align="center">&nbsp;</p>
                </td>
              <td width="50%"><p align="center">T&#7893;ng gi&aacute;m &#273;&#7889;c </p>
                  <p align="center" class="style8">General Director</p>
                  <p align="center"><?echo $GDName?>&nbsp;</p>
                <p align="center"><?if ($GDName) echo 'Electronically Approved'?>&nbsp;</p>
                <p align="center">&nbsp;</p></td>
            </tr>
        </table></div></td>
      </tr>
    </table></div></td>
  </tr>
</table>
<p>&nbsp;</p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="46%"><p class="style1">Nh&agrave; cung c&#7845;p &#273;&#432;&#7907;c ch&#7881; &#273;&#7883;nh/ Suppliers name:</p>
            <p class="style1">S&#7889; y&ecirc;u c&#7847;u mua v&#7853;t t&#432; RPs No (given by Purchasing Dept):</p>
          <p class="style1">Ng&agrave;y/ date:</p></td>
        <td width="54%"><p class="style1">&nbsp;</p>
            <p class="style1">&nbsp;</p>
          <p class="style1">B&#7897; ph&#7853;n mua h&agrave;ng/ Purchase Dept: </p></td>
      </tr>
    </table></td>
  </tr>
</table>
<?exit()?>
